<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <head>
        <title>Insert title here</title>
        <meta charset="UTF-8">
        <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
        <title>Hello, Bootstrap Table!</title>
        <meta charset="UTF-8">
        <title>Title</title>
        <script th:src="@{/js/jquery-3.2.1.min.js}"></script>
        <!-- 最新 Bootstrap4 核心 CSS 文件 -->
        <link href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

        <!--时间控件-->
        <link href="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css"
              rel="stylesheet">
        <!-- bootstrap.bundle.min.js 用于弹窗、提示、下拉菜单，包含了 popper.min.js -->
        <script rel="stylesheet" th:src="@{/js/bootstrap.bundle.min.js} "></script>
        <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
        <script rel="stylesheet" th:src="@{/js/bootstrap.min.js}"></script>
        <!-- BootStrapValidator -->
        <link href="https://cdn.bootcss.com/jquery.bootstrapvalidator/0.5.3/css/bootstrapValidator.min.css"
              rel="stylesheet">
        <script src="https://cdn.bootcss.com/jquery.bootstrapvalidator/0.5.3/js/bootstrapValidator.min.js"
                type="text/javascript"></script>
        <!--时间控件-->
        <script th:src="@{/daterangepicker/moment.js}"></script>
        <script src="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
        <script th:src="@{/js/functions.js}"></script>

    </head>
</head>
<body>
<div th:include="../templates/admin/top::headtop"></div>
<div class="container" id="content">
    <div class="row">
        <div th:include="../templates/admin/menu::headmenu"></div>
        <div class="col-md-10">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="row">
                        <h1 class="col-md-5">放映电影修改</h1>
                    </div>
                </div>

                <form class="form-inline" method="post" name="newMovie" onsubmit="return check()"
                      th:action="@{/admin/updataChartMovie}" enctype="multipart/form-data">
                    <table class="table">
                        <tbody>
                        <tr>
                            <td><input type="hidden" name="show_id" th:value="${MovieChartList.show_id}"></td>
                        </tr>


                        <tr>
                            <td>电影id号</td>
                            <td><input class="form-control" name="film_id" placeholder="请输入电影di" type="text" th:value="${MovieChartList.film_id}"/></td>
                        </tr>

                        <tr>
                            <td>放映室id号</td>
                            <td><input class="form-control" name="screens_id" placeholder="请输出在哪播放" type="text" th:value="${MovieChartList.screens_id}"/></td>
                        </tr>


                        <tr>
                            <td>播放时间</td>
                            <td>
                                <div class='input-group date' id='datetimepicker1'>
                                    <input class="form-control" type='text' name="starttime" th:value="${MovieChartList.starttime}"/>
                                    <span class="input-group-addon">
                                   <span class="glyphicon glyphicon-calendar"></span>
                                  </span>

                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>结束时间</td>
                            <td>
                                <div class='input-group date' id='datetimepicker2'>
                                    <input class="form-control" type='text' name="endtime" th:value="${MovieChartList.starttime}" />
                                    <span class="input-group-addon" >
                                   <span class="glyphicon glyphicon-calendar"></span>
                                  </span>

                                </div>
                            </td>
                        </tr>

                        <tr>
                            <td>价格</td>
                            <td><input class="form-control" name="show_price" placeholder="请输票价" type="text" th:value="${MovieChartList.show_price}"/></td>
                        </tr>

                        <tr>

                            <td><input class="btn btn-default" type="submit" value="提交" /></td>
                            <td><input class="btn btn-default" type="reset" value="重置"/></td>
                        </tr>
                        </tbody>
                    </table>
                </form>

                </div>
            </div>
        </div>
    </div>
</div>


<div aria-hidden="true" aria-labelledby="myModalLabel" class="modal fade" id="film_Intro" role="dialog" tabindex="-1">
    <td><textarea class="form-control" cols="20" name="film_Intro" rows="5"></textarea></td>
</div>
<script type="text/javascript">
    //时间控件


    $(function () {
        $('#datetimepicker2').datetimepicker({
            format: 'YYYY-MM-DD hh:mm',
            locale: moment.locale('zh-cn')
        });
        $('#datetimepicker1').datetimepicker({
            format: 'YYYY-MM-DD hh:mm',
            locale: moment.locale('zh-cn')
        });
    });

    function deleteChartMovie() {
        var str = [];
        var sel = document.getElementsByName("chk");//获取checkbox的值
        console.log(sel)
        for (var i = 0; i < sel.length; i++)
            if (sel[i].checked == true)
                str.push(sel[i].value);
        if (str == "") {
            alert("请至少选择一条记录");
            return false;
        }


        // if(window.confirm("确定删除吗")){
        //     window.location="./DeleteUser?userids="+str;
        // }

        if (window.confirm("确定删除吗")) {
            $.post(getContextPath() + "/admin/deleteChartMovie", {show_ids: str.join(",")}, function (data) {
                window.location.reload();
            });
        }
    }

    function Updata(show_id) {

        window.location = getContextPath() + "/admin/findIdChartMovie?show_id=" + show_id;
        // $.post("./findIdUser",{userid : userid}, function (data) {
        //     window.location.reload();
        // });
    }

    function registerMadel() {
        $("#register").modal("show");
    }

    function film_IntroMadel() {

        $("#film_Intro").modal("show");
    }

</script>

</body>
</html>